import request from '@/utils/request'
import {
  ResponseData,
  MeetingInformationResponseData,
  meeting,
  bookMeeting,
  auditMeetings,
  meetingAddRemember,
  MeetingMemberResponseData,
  searchMember,
} from './type'
enum API {
  // 获取所有会议信息
  MEETINGDATAPAGE_URL = '/meeting/getMeeting',
  // 修改会议信息
  UPDATEMEETING_URL = '',
  // 删除会议
  DELETEMEETING_URL = '/meeting/deleteMeeting',
  // 预约会议接口
  BOOKMEETING_URL = '/meeting/addMeeting',
  // 批量审核会议
  AUDITMEETING_URL = '/meeting/auditMeeting',
  // 批量添加会议成员
  ADDMEETINGMEMBER_URL = '/meeting/addMembers',
  // 获取对应会议的会议成员
  GETMEETINGMEMBER_URL = '/meetingRemember/getAllMeetingRemember',

  DELETEMEETINGDATA_URL = '/meeting/deleteMeeting',

  DELETEMEMBERDATA_URL = '/meetingRemember/deleteMeetingRemember',
}

export const reqMeetingPageData = (params: meeting) =>
  request.get<any, MeetingInformationResponseData>(API.MEETINGDATAPAGE_URL, {
    params: params,
  })

export const reqAddBookMeetingData = (data: bookMeeting) =>
  request.post<any, ResponseData>(API.BOOKMEETING_URL, data)

export const reqAuditmeeting = (data: auditMeetings) =>
  request.put<any, ResponseData>(API.AUDITMEETING_URL, data)

export const reqAddMeetingMember = (data: meetingAddRemember) =>
  request.post<any, ResponseData>(API.ADDMEETINGMEMBER_URL, data)

export const reqGetMeetingMember = (params: searchMember) =>
  request.get<any, MeetingMemberResponseData>(API.GETMEETINGMEMBER_URL, {
    params: params,
  })

export const reqDeleteMeetingData = (idList: number[]) =>
  request.delete<any, ResponseData>(API.DELETEMEETINGDATA_URL, { data: idList })

export const reqDeleteMemberData = (idList: number[]) =>
  request.delete<any, ResponseData>(API.DELETEMEMBERDATA_URL, { data: idList })
